package com.xiaoshuidi.cloud.module.member.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum SecurityCheckOverdueStatusEnum {

    NOT_OVERDUE("未逾期", 0),
    OVERDUE("已逾期", 1),
    OVERDUE_SOON("即将逾期", 2);

    private final String name;
    private final Integer value;

    public static String getNameByValue(Integer value){
        SecurityCheckOverdueStatusEnum securityCheckOverdueStatusEnum = Arrays.stream(SecurityCheckOverdueStatusEnum.values()).filter(p -> p.getValue().equals(value)).findFirst().orElse(null);
        if(ObjectUtil.isEmpty(securityCheckOverdueStatusEnum)){
            return "";
        }
        return securityCheckOverdueStatusEnum.getName();
    }
}
